<% content_for :menu do %>
	<menu>
		<ul>
			<li ><%= link_to 'Accueil', :controller => :supervision %></li>
			<li><%= link_to 'Gestion des salles', :controller => :salles, :action => :index %></li>
			<li id="femme_actuelle"><%= link_to 'Gestion des machines', :controller => :machines, :action => :index %></li>
			<li><%= link_to 'Gestion des incidents', :controller => :incidents, :action => :index %></li>
			<li><%= link_to 'Gestion des logs', :controller => :logs, :action => :index %></li>
			<li><%= link_to 'Metriques', :controller => :stats, :action => :index %></li>
		</ul>
	</menu>
<% end %>

<% machine_id = "machine_"+@machine.id.to_s %>
  <tr id="tr_<%= machine_id %>">

    <td ><span class="handle_machine_<%= salle_id %>"><%= image_tag('dnd-move-linux.png', :alt =>"move", :height =>"32px", :width =>"32px") %></span></td>

    <td classe="bordure">
		<span id="span_<%= machine_id %>" class="machine" style="cursor:move" >
			<%= image_tag('computer.png', :alt =>"Computer", :height =>"16px", :width =>"16px") %>&nbsp;&nbsp;<strong><%=h machine.nom_machine %></strong><br />
			<em><%=h machine.adresse_ip %></em>
		</span>
    </td>
    <td classe="bordure">
    	<%= link_to_remote "Ping", 
    		:update => "result_ping_machine_"+machine.id.to_s, 
    		:url => { :controller => :machines, :action => "ping", :adresse_ip => machine.adresse_ip },
    		:before => "$('loading_ping_machine_"+machine.id.to_s+"').show()",
    		:script => true,
    		:complete => "$('loading_ping_machine_"+machine.id.to_s+"').hide()"
    		 
    	%>
    	<%= image_tag('loading.gif', :id => "loading_ping_machine_"+machine.id.to_s, :style => "display:none", :alt =>"chargement", :height =>"16px", :width =>"16px" )%>
    	<div id="result_ping_machine_<%= machine.id.to_s %>"></div>
    </td>
    <td><span class="bouton"><%= link_to 'Voir', machine %></span></td>
    <td><span class="bouton"><%= link_to 'Modifier', edit_machine_path(machine) %></span></td>
    <td><span class="delete">
    	<%= link_to_remote 'Supprimer', 
	    			:url => {:controller => :machines, :action => :destroy}, 
	    			:with => "'id=#{machine.id}'",
	    			#:update => 'table_salle_'+machine.salle_id.to_s,
	    			:before => "$('loading_delete_machine_"+machine.id.to_s+"').show()",
	    			:position => "bottom",
	    			:script => true, 
	    			:confirm => 'Etes-vous sur de supprimer cette machine ?'%>
	    </span>
	</td>
	<td><%= getIncidentByMachine(machine.id) %></td>
	<td><%= image_tag('loading.gif', :id => "loading_delete_machine_"+machine.id.to_s, :style => "display:none", :alt =>"chargement", :height =>"16px", :width =>"16px")%></td>
	<%= draggable_element("span_"+machine_id.to_s, :revert=>true, :ghosting => true, :change  => "function() { $('trash').show() }") %>
  </tr>